package engine.app;

import javafx.animation.AnimationTimer;

public class Engine extends AnimationTimer {

    OnStart onStart;
    OnUpdate onUpdate;
    OnStop onStop;

    @Override
    public void start() {
        super.start();
        onStart.onStartHandle();
    }

    @Override
    public void stop() {
        onStop.OnStopHandle();
        super.stop();
    }

    @Override
    public void handle(long l) {
        onUpdate.OnUpdateHandle();
    }


    public interface OnStart {
        void onStartHandle();
    }

    public interface OnUpdate {
        void OnUpdateHandle();
    }

    public interface OnStop {
        void OnStopHandle();
    }
}
